﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Index.cshtml";
}
@section Content{
    <style>
        .panel-default {
            border-radius: 0;
            padding-top: 5px;
        }

        .panel-primary {
            border-top-width: 0;
            border-radius: 0;
            border-color: #ddd;
        }

            .panel-primary > .panel-heading {
                color: #fff;
                border-color: #1ABC9C;
                background-color: #1ABC9C;
            }

        .panel-heading {
            border-radius: 0;
        }

        .nav-tabs > li > a {
            border-radius: 0;
        }
    </style>
    @RenderSection("Content", false)
}

<div class="topPanel">
    <div class="toolbar">
        <div class="btn-group">
            <a id="btnOpenReport" href="javascript:void(0);" class="btn btn-primary btn-sm">日报记录</a>
            <a id="btnWriteReport" href="javascript:void(0);" class="btn btn-info btn-sm">写日报</a>
            <a id="btnCloseOrder" href="javascript:void(0);" class="btn btn-danger btn-sm">关闭订单</a>
            <a id="btnHide" href="javascript:void(0);" class="btn btn-default btn-sm" title="隐藏面版"><span class="glyphicon glyphicon-resize-small"></span></a>
        </div>
    </div>
    <div class="search">
        <table>
            <tr>
                <td>
                    <span class="h4">需求资料</span>
                </td>
            </tr>
        </table>
    </div>
</div>
<form id="baseForm" class="form-inline" style="border: 1px dashed transparent; display:none;">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <span class="h5">客户需求</span>
        </div>
        <table class="table table-border table-hover">
            <tr>
                <td>
                    <table class="form">
                        <tr>
                            <th class="formTitle">活动主题：</th>
                            <td class="formValue">
                                <input type="hidden" id="F_WorkFormId" name="F_WorkFormId" value="" />
                                <input type="hidden" id="DemandId" name="DemandId" value="" />
                                <input type="hidden" id="ContactId" name="ContactId" value="" />
                                <input type="hidden" id="ProjectId" name="ProjectId" value="" />
                                <input type="hidden" id="ClientId" name="ClientId" value="" />
                                
                                <input type="hidden" id="F_ActivityCityName" name="F_ActivityCityName" value="" />
                                <input type="hidden" id="F_ActivityTypeName" name="F_ActivityTypeName" value="" />
                                <input id="F_ActivityTheme" name="F_ActivityTheme" type="text" class="form-control" style="width:99%" />
                            </td>
                            <th class="formTitle">活动城市：</th>
                            <td class="formValue">
                                <select id="F_ActivityCityId" name="F_ActivityCityId" class="form-control" multiple></select>
                            </td>
                            <th class="formTitle">搭建日期：</th>
                            <td class="formValue">
                                <input id="F_BuildDate" name="F_BuildDate" type="text" class="form-control input-wdatepicker" readonly onfocus="WdatePicker()" style="width:240px" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">活动类型：</th>
                            <td class="formValue">
                                <select id="F_ActivityType" name="F_ActivityType" class="select2-container select2-container--default select2-container--open"></select>
                            </td>
                            <th class="formTitle">场地类型：</th>
                            <td class="formValue">
                                @*<select id="F_SiteType" name="F_SiteType" class="form-control required"></select>*@
                                <select id="F_SiteType" name="F_SiteType" class="form-control" multiple></select>
                            </td>
                            <th class="formTitle">活动时间：</th>
                            <td class="formValue">
                                <div class="input-group">
                                    <input id="F_ActivityStartDate" name="F_ActivityStartDate" type="text" class="form-control input-wdatepicker" readonly onfocus="WdatePicker()" style="width:100px;">
                                    <div class="input-group-addon" style="border-right-width: 0; border-left-width: 0;">至</div>
                                    <input id="F_ActivityEndDate" name="F_ActivityEndDate" type="text" class="form-control input-wdatepicker" readonly onfocus="WdatePicker()" style="width:100px;">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">空间面积(㎡)：</th>
                            <td class="formValue">
                                <input id="F_SiteArea" name="F_SiteArea" type="text" class="form-control number" style="width:99%" />
                            </td>
                            <th class="formTitle">容纳人数：</th>
                            <td class="formValue">
                                <input id="F_PersionNumber" name="F_PersionNumber" type="text" class="form-control number" style="width:99%" />
                            </td>
                            <th class="formTitle">层高(m)：</th>
                            <td class="formValue">
                                <input id="F_Height" name="F_Height" type="text" class="form-control number" style="width:99%" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">预算金额(元)：</th>
                            <td class="formValue">
                                <input id="F_DemandCash" name="F_DemandCash" type="text" class="form-control number" style="width:99%" />
                            </td>
                            <th class="formTitle">客户备注信息：</th>
                            <td class="formValue" colspan="3">
                                <textarea id="F_Note" name="F_Note" class="form-control" style="width:97%"></textarea>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <div class="panel-heading">
            <span class="h5">公司信息</span>
        </div>
        <table class="table table-border table-hover">
            <tr>
                <td>
                    <table class="form">
                        <tr>
                            <th class="formTitle">公司名称：</th>
                            <td class="formValue">
                                <input id="F_ClientName" name="F_ClientName" type="text" class="form-control" style="width:99%" />
                            </td>
                            <th class="formTitle">客户级别：</th>
                            <td class="formValue">
                                <input id="F_ClientLevelName" name="F_ClientLevelName" type="text" class="form-control" disabled style="width:99%" />
                            </td>
                            <th class="formTitle">客户类型：</th>
                            <td class="formValue">
                                <input id="F_ClientTypeName" name="F_ClientTypeName" type="text" class="form-control" disabled style="width:99%" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <div class="panel-heading">
            <span class="h5">联系人</span>
        </div>
        <table class="table table-border table-hover">
            <tr>
                <td>
                    <table class="form">
                        <tr>
                            <th class="formTitle">品牌项目组：</th>
                            <td class="formValue">
                                <input id="F_ProjectName" name="F_ProjectName" type="text" class="form-control" style="width:99%" />
                            </td>
                            <th class="formTitle">联系人：</th>
                            <td class="formValue">
                                <input id="F_Contact" name="F_Contact" type="text" class="form-control" style="width:99%" />
                            </td>
                            <th class="formTitle">所属部门：</th>
                            <td class="formValue">
                                <select id="F_DepartmentId" name="F_DepartmentId" class="form-control"></select>
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">公司职位：</th>
                            <td class="formValue">
                                <select id="F_PositionId" name="F_PositionId" class="form-control"></select>
                            </td>
                            <th class="formTitle">联系电话：</th>
                            <td class="formValue">
                                <input id="F_Phone" name="F_Phone" type="text" class="form-control isMobile" style="width:99%" />
                            </td>
                            <th class="formTitle">公司邮箱：</th>
                            <td class="formValue">
                                <input id="F_Mail" name="F_Mail" type="text" class="form-control email" style="width:99%" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle"></th>
                            <td class="formValue">
                            </td>
                            <th class="formTitle"></th>
                            <td class="formValue">
                            </td>
                            <th class="formTitle"></th>
                            <td class="formValue">
                                <button id="btn_save_order_request" name="btn_save_order_request" class="btn btn-primary btn-sm" type="button">修改并保存</button>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
</form>

@RenderBody()

<script>
    $(function () {
        $('#btnHide').bind({
            'mouseover': function () {
                $("#baseForm").css({ "border-color": "red" });
            },
            'mouseout': function () {
                $("#baseForm").css({ "border-color": "transparent" });
            },
            'click': function () {
                if ($(this).children().hasClass("glyphicon-resize-small")) {
                    $(this).prop("title", "展开面版").children().removeClass("glyphicon-resize-small").addClass("glyphicon-resize-full");
                } else {
                    $(this).prop("title", "隐藏面版").children().removeClass("glyphicon-resize-full").addClass("glyphicon-resize-small");
                }
                $("#baseForm").toggle();
            }
        });
        $("#btn_save_order_request").click(function () {
            if (!$('#baseForm').formValid()) {
                return false;
            }

            $.modalConfirm('您确认要修改此订单的需求信息吗？', function (flag, index) {
                if (flag) {
                    var param = $("#baseForm").formSerialize();
                    //console.log(param);
                    $.submitForm({
                        url: "/OrderFlowManage/ClientOrder/SubmitBaseDemandForm?keyValue=",
                        param: param,
                        success: function (data) {
                            $.modalConfirmClose(index);
                        }
                    });
                    
                }
            });
        });
    });
</script>